home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / text_utl / mtext130 / demo.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-09-27  |  8.7 KB  |  272 lines

  1. VERSION 2.00
  2. Begin Form Demo 
  3.    BackColor       =   &H00FFFFFF&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "MultiText v1.30 Demo"
  6.    ClientHeight    =   4005
  7.    ClientLeft      =   510
  8.    ClientTop       =   1350
  9.    ClientWidth     =   8790
  10.    Height          =   4695
  11.    Icon            =   DEMO.FRX:0000
  12.    Left            =   450
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   4005
  16.    ScaleWidth      =   8790
  17.    Top             =   720
  18.    Width           =   8910
  19.    Begin OptionButton Option3 
  20.       Caption         =   "Auto"
  21.       Height          =   255
  22.       Left            =   5640
  23.       TabIndex        =   6
  24.       Top             =   3600
  25.       Width           =   975
  26.    End
  27.    Begin OptionButton Option2 
  28.       Caption         =   "Off"
  29.       Height          =   255
  30.       Left            =   4920
  31.       TabIndex        =   7
  32.       Top             =   3600
  33.       Width           =   615
  34.    End
  35.    Begin OptionButton Option1 
  36.       Caption         =   "On"
  37.       Height          =   255
  38.       Left            =   4200
  39.       TabIndex        =   8
  40.       Top             =   3600
  41.       Value           =   -1  'True
  42.       Width           =   615
  43.    End
  44.    Begin CommandButton Command2 
  45.       Caption         =   "Load RTF"
  46.       Height          =   285
  47.       Left            =   5280
  48.       TabIndex        =   5
  49.       Top             =   3120
  50.       Width           =   1095
  51.    End
  52.    Begin CommandButton Command1 
  53.       Caption         =   "Load"
  54.       Height          =   285
  55.       Left            =   4560
  56.       TabIndex        =   4
  57.       Top             =   3120
  58.       Width           =   615
  59.    End
  60.    Begin TextBox Text1 
  61.       Height          =   285
  62.       Left            =   1200
  63.       TabIndex        =   2
  64.       Top             =   3120
  65.       Width           =   3135
  66.    End
  67.    Begin SBMultiText MultiText1 
  68.       AutoPaint       =   -1  'True
  69.       AutoScrollbar   =   0   'False
  70.       BackColor       =   &H00FFFFFF&
  71.       BorderStyle     =   1  'Fixed Single
  72.       DefArial        =   ""
  73.       DefCourier      =   ""
  74.       DefCourierNew   =   ""
  75.       DefFixedSys     =   ""
  76.       DefModern       =   ""
  77.       DefMSSansSerif  =   ""
  78.       DefMSSerif      =   ""
  79.       DefRoman        =   ""
  80.       DefScript       =   ""
  81.       DefSmallFonts   =   ""
  82.       DefSymbol       =   ""
  83.       DefSystem       =   ""
  84.       DefTerminal     =   ""
  85.       DefTimesNewRoman=   ""
  86.       DefWingDings    =   ""
  87.       FontName        =   4  'MS Sans Serif      
  88.       FontSize        =   22
  89.       ForeColor0      =   &H00000000&
  90.       ForeColor1      =   &H000000FF&
  91.       ForeColor2      =   &H00FF0000&
  92.       ForeColor3      =   &H0000FF00&
  93.       ForeColor4      =   &H00FF00FF&
  94.       ForeColor5      =   &H00FFFF00&
  95.       ForeColor6      =   &H0000FFFF&
  96.       ForeColor7      =   &H00808080&
  97.       ForeColor8      =   &H00008000&
  98.       ForeColor9      =   &H00FFFFFF&
  99.       Height          =   2775
  100.       Highlight       =   &H8000000D&
  101.       HilightEnabled  =   0   'False
  102.       HiTextColor     =   &H8000000E&
  103.       IndentLeft      =   4
  104.       IndentRight     =   4
  105.       Left            =   120
  106.       LoadLength      =   0
  107.       LoadStart       =   0
  108.       Scrollbar       =   -1  'True
  109.       SpecialChar     =   91
  110.       TabIndex        =   1
  111.       TableGap        =   20
  112.       TabWidth        =   30
  113.       Text            =   ""
  114.       Top             =   120
  115.       UserFont        =   ""
  116.       Width           =   8055
  117.    End
  118.    Begin CheckBox Check1 
  119.       Caption         =   "Enable text selection"
  120.       Height          =   255
  121.       Left            =   240
  122.       TabIndex        =   0
  123.       Top             =   3600
  124.       Width           =   2415
  125.    End
  126.    Begin Label Label2 
  127.       AutoSize        =   -1  'True
  128.       BackStyle       =   0  'Transparent
  129.       Caption         =   "Scroll Bar :"
  130.       Height          =   195
  131.       Left            =   3120
  132.       TabIndex        =   9
  133.       Top             =   3630
  134.       Width           =   960
  135.    End
  136.    Begin Label Label1 
  137.       AutoSize        =   -1  'True
  138.       Caption         =   "Filename : "
  139.       Height          =   195
  140.       Left            =   240
  141.       TabIndex        =   3
  142.       Top             =   3120
  143.       Width           =   945
  144.    End
  145.    Begin Image Image2 
  146.       Height          =   480
  147.       Left            =   8280
  148.       Picture         =   DEMO.FRX:0302
  149.       Top             =   1200
  150.       Width           =   480
  151.    End
  152.    Begin Image Image1 
  153.       Height          =   480
  154.       Left            =   8280
  155.       Picture         =   DEMO.FRX:0604
  156.       Top             =   600
  157.       Width           =   480
  158.    End
  159.    Begin Menu mnuFile 
  160.       Caption         =   "&File"
  161.       Begin Menu mnuExit 
  162.          Caption         =   "E&xit"
  163.       End
  164.    End
  165.    Begin Menu mnuEdit 
  166.       Caption         =   "&Edit"
  167.       Begin Menu mnuCopy 
  168.          Caption         =   "&Copy"
  169.       End
  170.       Begin Menu mnuCopyFormat 
  171.          Caption         =   "C&opy format"
  172.       End
  173.    End
  174. Option Explicit
  175. '   (c) 1995 Steve Bannister
  176. '   s.bannister@pobox.com
  177. Dim t$
  178. Sub Check1_Click ()
  179. '  Allow/Dis-allow user to select regions of text
  180.     If Check1.Value = 1 Then
  181.         multitext1.HilightEnabled = True
  182.     Else
  183.         multitext1.HilightEnabled = False
  184.     End If
  185. End Sub
  186. Sub Command1_Click ()
  187.     On Error GoTo errlabel
  188.     multitext1.LoadFile = text1.Text
  189.     Exit Sub
  190. errlabel:
  191.     Err = 0
  192.     MsgBox "Error loading file"
  193.     Exit Sub
  194. End Sub
  195. Sub Command2_Click ()
  196.     On Error GoTo errlabel2
  197.     multitext1.ImportRTF = text1.Text
  198.     Exit Sub
  199. errlabel2:
  200.     Err = 0
  201.     MsgBox "Error loading file"
  202.     Exit Sub
  203. End Sub
  204. Sub Form_Load ()
  205.     Dim c$
  206.     c$ = Chr$(10)
  207.     t$ = "[AWelcome to [tMultiText[A, a versatile non-editable text box capable of "
  208.     t$ = t$ & "displaying text using different [Cfonts[A and with "
  209.     t$ = t$ & "a variety of font [I[Uattributes[u[i." & c$ & c$
  210.     t$ = t$ & "You may even import and display [1RTF[0 text !" & c$ & c$
  211.     t$ = t$ & "Multiple [1colors [2can [3also [4be [5used [0but don't get "
  212.     t$ = t$ & "carried away !" & c$ & c$
  213.     t$ = t$ & "Text may also contain [8[ghyperlinks[cFirstTag[0 which [8[gwill[cSecondTag[0 cause an "
  214.     t$ = t$ & "event to occur when [g[8clicked[0[cThirdTag upon. New for v1.30 are tag words which can be associated "
  215.     t$ = t$ & "with each hyperlink." & c$ & c$
  216.     t$ = t$ & "Text may be selected, and copied to the clipboard. To "
  217.     t$ = t$ & "demonstrate, [Bcheck[b the box below, [Bselect[b some text "
  218.     t$ = t$ & "with the cursor, then select [BCopy[b from the [BEdit[b "
  219.     t$ = t$ & "menu above. Load [BClipboard Viewer[b and check out the "
  220.     t$ = t$ & "results." & c$ & c$
  221.     t$ = t$ & "[DSuperscript[d and [Gsubscript[d text can be included, as "
  222.     t$ = t$ & "can fractions, for example [BVolume of sphere V[Gs[d = [f4/3[Yp[Ar[D3[d[b" & c$ & c$
  223.     t$ = t$ & "Scrolling methods are included, for use with, say, a "
  224.     t$ = t$ & "custom scrollbar. Press the arrow buttons on the "
  225.     t$ = t$ & "right side of this form." & c$ & c$
  226.     t$ = t$ & "Text may also be loaded direct from file. To try this "
  227.     t$ = t$ & "out enter a filename below and press [BLoad[b." & c$ & c$
  228.     t$ = t$ & "New for version 1.30 are support" & Chr$(9) & "for" & Chr$(9) & "tabs, "
  229.     t$ = t$ & "redefinable fonts allowing up to 16 user-defined fonts available in "
  230.     t$ = t$ & "a single document. Also new is table handling, with automatic column "
  231.     t$ = t$ & "sizing, for example :" & c$ & c$
  232.     t$ = t$ & "[UState[hCapital[hNickname[u" & c$
  233.     t$ = t$ & "California[hSacramento[hGolden State" & c$
  234.     t$ = t$ & "New York[hAlbany[hEmpire State" & c$
  235.     t$ = t$ & "Washington[hOlympia[hEvergreen State"
  236.     multitext1.Text = t$
  237.     left = (screen.Width - Width) \ 2
  238. End Sub
  239. Sub Image1_Click ()
  240. '  Scroll Up
  241.     multitext1.ScrollUp = True
  242. End Sub
  243. Sub Image2_Click ()
  244. '  Scroll Down
  245.     multitext1.ScrollDown = True
  246. End Sub
  247. Sub mnuCopy_Click ()
  248.     multitext1.Copy = True
  249. End Sub
  250. Sub mnuCopyFormat_Click ()
  251.     multitext1.CopyFormat = True
  252. End Sub
  253. Sub mnuExit_Click ()
  254.     End
  255. End Sub
  256. Sub MultiText1_Hot (HotIndex As Integer, HotWord As String)
  257.     Dim ht$
  258.     ht$ = multitext1.HotTag
  259.     MsgBox "You pressed '" & HotWord & "' (" & ht & ")"
  260. End Sub
  261. Sub Option1_Click ()
  262.     multitext1.AutoScrollbar = False
  263.     multitext1.Scrollbar = True
  264. End Sub
  265. Sub Option2_Click ()
  266.     multitext1.AutoScrollbar = False
  267.     multitext1.Scrollbar = False
  268. End Sub
  269. Sub Option3_Click ()
  270.     multitext1.AutoScrollbar = True
  271. End Sub
  272.